<?php $this->load->view('layout/header');?>
<div class="supplier-content-page">
    <div class="product-test-h5">
        <ul class="breadcrumb">
            <li><a href="javascript:;">商品管理</a></li>
            <li><a href="<?php echo site_url('tourismreviews/grid')?>">评价管理</a></li>
            <li class="active"><a href="<?php echo site_url('tourismreviews/detail')?>">评价详情</a></li>
        </ul>
        <div class="product-view-area"><p>评价详情</p></div>
        <?php echo execute_alert_message() ?>
        <?php foreach ($reviewDetail->result() as $item) : ?>
        <div class="add-form">
            <div class="add-product table-infom">
                <table class="table">
                    <thead>
                        <tr>
                            <th>商品名称</th>
                            <th>单价（元）</th>
                            <th>数量</th>
                            <th>小计（元）</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="baobei">
                                <div class="media">
                                    <div class="media-left">
                                        <a target="_blank" href="<?php echo $this->config->wap_base_url.'tourismgoods/info/'.$item->goods_attr_id.'.html' ?>">
                                            <img class="media-object lazy" src="skins/images/load.jpg" data-original="<?php echo $this->config->show_image_url($item->goods_image) ?>" style="width: 80px; height: 80px;">
                                        </a>
                                    </div>
                                    <div class="media-body">
                                        <h4 class="media-heading"><?php echo $item->goods_name ?></h4>
                                        <span><?php echo $item->attribute_value ?></span>
                                    </div>
                                </div>
                            </td>
                            <td><?php echo $item->supply_price?></td>
                            <td><?php echo $item->refund_num?></td>
                            <td><?php echo bcmul($item->refund_num, $item->supply_price, 2);?></td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <form class="public-validate-form form-horizontal" action="<?php echo site_url('tourismreviews/reviewsReply') ?>" method="post" enctype="multipart/form-data" id="tourismorderrefund_form">
                <div class="add-product">
                    <div class="fonter-add">基本信息</div>
                    <div class="form-group">
                        <label class="control-label">客户帐号：</label>
                        <div class="col-xs-10">
                            <span><?php echo $item->user_name?></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">评分（星）：</label>
                        <div class="col-xs-10">
                            <ul class="review-show-stars clearfix">
                                <?php for ($i=1; $i <= 5; $i++) :?>
                                <li <?php if ($i <= $item->review_score) :?>class="active"<?php endif;?>><i class="glyphicon glyphicon-star"></i></li>
                                <?php endfor;?>
                            </ul>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">客户评价：</label>
                        <div class="col-xs-10">
                            <span><?php echo $item->user_content;?></span>
                        </div>
                    </div>
                    <?php if ($item->reply_id) :?>
                        <div class="form-group">
                            <label class="control-label">您的回复：</label>
                            <div class="col-xs-10">
                                <span><?php echo $item->reply_content;?></span>
                            </div>
                        </div>
                    <?php else : ?>
                        <div class="form-group">
                            <label class="control-label">请您回复：</label>
                            <div class="col-xs-8">
                                <input type="hidden" name="review_id" value="<?php echo $item->id;?>">
                                <input type="hidden" name="reply_user_name" value="<?php echo $this->userName;?>">
                                <textarea name="reply_content" rows="3" minlength="6" class="form-control required"></textarea>
                            </div>
                        </div>
                    <?php endif;?>
                    <div class="form-group">
                        <label class="control-label">评价时间：</label>
                        <div class="col-xs-10">
                            <span><?php echo $item->created_at; ?></span>
                        </div>
                    </div>
                    <?php if ($item->reply_id) :?>
                        <div class="form-group">
                            <label class="control-label">回复时间：</label>
                            <div class="col-xs-10">
                                <span><?php echo $item->reply_time; ?></span>
                            </div>
                        </div>
                    <?php endif;?>
                </div>
                <?php if (!$item->reply_id) :?>
                <div class="sup-submit">
                    <button class="btn btn-default" type="submit">保存</button>
                    <a href="<?php echo site_url('tourismorderrefund/grid') ?>">返回上一步</a>
                </div>
                <?php endif;?>
            </form>
        </div>
        <?php endforeach;?>
    </div>
</div>
<?php $this->load->view('layout/footer') ?>